/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 */
'use strict';
import * as types from '../actions/actionTypes';

const initialState = {
  scanBarCodeText: '',
};

export default function app(state = initialState, action = {}) {
    switch (action.type) {
        case types.SCAN_BARCODE_RESULT:
            return Object.assign({}, state, {
                scanBarCodeText:action.data
            });
        case types.SCAN_BARCODE_CLEAN:
            return Object.assign({}, state, {
                scanBarCodeText:''
            });
        case types.CHANGE_INPUT_ORDERID:
            return Object.assign({}, state, {
                scanBarCodeText:action.orderId
            });    
        default:
            return state;
    }
}